<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org/">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

    <div th:fragment="top" class="header_con">
        <div class="header">
            <div class="welcome fl">欢迎来到范闲商城!</div>
            <div class="topbar-info fr">
                <th:block th:if="${session.user!=null}">
                    <div class="fr">
                        <div class="user_link fl">
                            欢迎您：<em th:text="${session.user.name}"></em>
                            <img class="avatar-img" th:src="${session.user.image}" />
                            <span>|</span>
                            <a href="/page/user/info">用户中心</a>
                            <span>|</span>
                            <a href="/page/cart">我的购物车</a>
                            <span>|</span>
                            <a href="/page/user/order">我的订单</a>
                            <span>|</span>
                            <a href="javascript:logout()">注销</a>
                        </div>
                    </div>
                </th:block>
                <th:block th:if="${session.user==null}">
                    <div class="login_btn fl">
                        <th:block th:if="${returnUri == null}">
                            <a th:href="|/page/login?returnUri=/|">登录</a>
                            <span>|</span>
                            <a th:href="|/page/register?returnUri=/|">注册</a>
                        </th:block>
                        <th:block th:if="${returnUri != null}">
                            <a th:href="|/page/login?returnUri=${returnUri}|">登录</a>
                            <span>|</span>
                            <a th:href="|/page/register?returnUri=${returnUri}|">注册</a>
                        </th:block>
<!--                        <a th:href="|/page/login?returnUri=${returnUri}|">登录</a>-->

                    </div>
                </th:block>
            </div>


        </div>
    </div>

</body>
</html>